import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;

import jason.environment.grid.GridWorldView;

public class View extends GridWorldView {
	private static final long serialVersionUID = 1L;
	Model model ;

	public View(Model model) {
		super(model, "Room World", 800);
		this.model = model ;
		defaultFont = new Font("Arial", Font.BOLD, 10); // change default
														// font
		setVisible(true);
		repaint();

	}

	/** draw application objects */
	@Override
	public void draw(Graphics g, int x, int y, int object) {
		switch (object) {
		case Model.GARB:
			drawGarb(g, x, y);
			break;
		}
	}

	@Override
	public void drawAgent(Graphics g, int x, int y, Color c, int id) {
		String label = "R" + (id + 1);
		if (id == 0) {
			c = Color.yellow;
		}
		super.drawAgent(g, x, y, c, -1); // goi ham drawAgent goc 
			g.setColor(Color.black);
		super.drawString(g, x, y, defaultFont, label);
	}

	
	public void drawGarb(Graphics g, int x, int y) {
		g.setColor(Color.green);
		super.drawObstacle(g, x, y);
		g.setColor(Color.white);
		drawString(g, x, y, defaultFont, "G");
	}

}
